home *** CD-ROM | disk | FTP | other *** search
- ' Please follow these steps to use this program.
- '
- ' 1) Copy your symbols to a folder off the C drive
- ' that has 3 letters in it's name, c:\CAD for
- ' example.
- '
- ' 2) Go to that directory at DOS and type:
- ' DIR /B >Files.txt. This creates the ASCII text
- ' file containing the files to be opened.
- '
- ' 3) Copy files.txt to files2.txt, which creates the
- ' file of filenames to be used.
- '
- ' 4) Create an ASCII text file called count.txt in that
- ' same directory that contains 20 lines, each with
- ' a single number on it, 1-20.
- '
- ' 5) Go to DesignCAD and setup the file locations tab
- ' for Drawings to read to that directory, then
- ' Save as Default.
- '
- ' About Running the Program . . .
- '
- ' 1) This program makes copies of each symbol in the
- ' group, so make sure your directory you are working
- ' with is a copy of the origional, because it will
- ' end up being twice as large as you wanted it to be.
- '
- ' 2) When prompted, please enter an output filename
- ' simular to c:\1.dc to avoid confusion. There is
- ' no error trapping for overwriting an existing file.
- ' You need large amounts of free HD space.
- '
- ' Get imput from user
- Start:
- Input "Please type the Archive Name & press Enter:", ARC$
- Input "Please type the Group Description & press Enter", DIS$
- Input "Please type the Symbol Group ID", GID$
- Window 10, 80
- Print "Archive " + ARC$
- Print "Description " + DIS$
- Print "Group ID " + GID$
- Print ""
- Print "Is this correct? Y/N"
- Anykey F$
- if F$ = "n" then
- goto Start
- endif
- if F$ = "N" then
- goto Start
- endif
- Count = 0
- ' Set's the target file to open
- Root$ = Sys$(20)
- File$ = Root$ + "\" + "Files.txt"
- File2$ = Root$ + "\" + "Count.txt"
- File3$ = Root$ + "\" + "Files2.txt"
- ' Opens the files
- open "i", 1, File$
- open "i", 4, File3$
- ' Loop Until End of File
- Back2:
- open "o", 3, "c:\List.txt"
- open "i", 2, File2$
- do while eof(1) = 0
- if Count = 20 then goto Full
- Input #1, A$
- Input #2, FName$
- B$ = Root$ + "\" + A$
- ' Opens the file, Fits it to Window
- >Open
- {
- <Filename [B$]
- }
- >FitToAllWindow
- {
- }
- MinX = Sys(120)
- MinY = Sys(121)
- MaxX = Sys(122)
- MaxY = Sys(123)
- ' Sets the new drawing handles for each file
- >DrawingHandle
- {
- <PointXYZ [MinX, MinY, 0]
- <PointXYZ [MaxX, MinY, 0]
- }
- ' Saves the incremental File
- FName2$ = Root$ + "\" + FName$ + A$
- >SaveAs
- {
- <SaveChanges 0
- <FileName [FName2$]
- }
- ' Writes Value to Third ASCII Text File
- print #3, FName2$
- ' Closes Current Drawing File
- >Close
- {
- }
- Count = Count + 1
- loop
- ' close 1
- end
-
- Full:
- ' Close All open ASCII text files
- ' Close 1
- Close 2
- Close 3
- ' Close the Current Document and open a New One
- Count = 0
- >Close
- {
- }
- >New
- {
- }
- ' Draws the First Box
- >2DBox
- {
- <Color 0,0,0
- <Layer 1
- <LineStyle 0,2.0000,0.0000
- <PointXYZ 0,0,0
- <PointXYZ 4,-5,0
- <Type 1
- <Orientation 0
- }
- ' Selects the Box
- >PointSelect
- {
- <PointXYZ 0,0,0
- <Type 0
- }
- ' Makes Copies of the Box in a Row
- >Array
- {
- <PointXYZ 4,0,0
- <PointXYZ 0,-5,0
- <NCopy 5,4,1
- <AlongCurve 0
- <Perpendicular 0
- }
- ' Fits the drawing to the current window
- >FitToWindow
- {
- }
- ' Adds the 1
- >Text
- {
- <Color 0,0,0
- <Layer 1
- <PointXYZ [.3, -4, 0]
- <PointXYZ [.3, -4, 0]
- <Style 0
- <Justification 0
- <Size .25
- <Angle 0.0000
- <Font "Arial"
- <Text "1"
- }
- ' Selects the 1
- >PointSelect
- {
- <PointXYZ .3, -4, 0
- <Type 0
- }
- ' Arrays the 1
- >Array
- {
- <PointXYZ 4.3, -4, 0
- <PointXYZ .3, -9, 0
- <NCopy 5,4,1
- <AlongCurve 0
- <Perpendicular 0
- }
- ' Adds the 2
- >Text
- {
- <Color 0,0,0
- <Layer 1
- <PointXYZ [3.7, -4, 0]
- <PointXYZ [3.7, -4, 0]
- <Style 0
- <Justification 0
- <Size .25
- <Angle 0.0000
- <Font "Arial"
- <Text "2"
- }
- ' Selects the 2
- >PointSelect
- {
- <PointXYZ 3.7, -4, 0
- <Type 0
- }
- ' Arrays the 2
- >Array
- {
- <PointXYZ 7.7, -4, 0
- <PointXYZ 3.7, -9, 0
- <NCopy 5,4,1
- <AlongCurve 0
- <Perpendicular 0
- }
- ' Loop for Symbols
- XD = 0
- YD = -5
- XA = .5
- YA = -4
- XB = 3.5
- YB = -4
- Count2 = 0
- open "i", 3, "c:\list.txt"
- For A = 1 to 20
- Count2 = Count2 + 1
- Input #3, C$
- ' Loads the Symbol
- >Merge
- {
- <Layer 1
- <PointXYZ [XA, YA, 0]
- <PointXYZ [XB, YB, 0]
- <Filename [C$]
- <Type 1
- <Scale 0
- <Reference 0
- }
- XA = XA + 4
- XB = XB + 4
- if Count2 = 5 then
- YA = YA - 5
- YB = YB - 5
- XA = .5
- XB = 3.5
- endif
- if Count2 = 10 then
- YA = YA - 5
- YB = YB - 5
- XA = .5
- XB = 3.5
- endif
- if Count2 = 15 then
- YA = YA - 5
- YB = YB - 5
- XA = .5
- XB = 3.5
- endif
- ' Draws the New Line
- >Line
- {
- <Color 0,0,0
- <Layer 1
- <LineStyle 0,2.0000,0.0000
- <PointXYZ [XD, YD, 0]
- <PointXYZ [XD + 2, YD, 0]
- <PointXYZ [XD + 2, YD + .25, 0]
- }
- ' Selects the line just drawn
- >PointSelect
- {
- <PointXYZ [XD + 2, YD + .25, 0]
- <Type 0
- }
- ' Deletes that line
- >SelectDelete
- {
- }
- ' Adds text to the box
- Input #4, Z$
- Chop = LEN(Z$)
- Chop2 = Chop - 3
- Y$ = LEFT$(Z$, Chop2)
- X$ = "(" + Y$ + ")"
- >Text
- {
- <Color 0,0,0
- <Layer 1
- <PointXYZ [XD + 2, YD + .25, 0]
- <PointXYZ [XD + 2, YD + .25, 0]
- <Style 0
- <Justification 0
- <Size .25
- <Angle 0.0000
- <Font "Arial"
- <Text [X$]
- }
- XD = XD + 4
- if Count2 = 5 then
- YD = YD -5
- XD = 0
- endif
- if Count2 = 10 then
- YD = YD -5
- XD = 0
- endif
- if Count2 = 15 then
- YD = YD -5
- XD = 0
- endif
- Next a
- ' Draws the Top Box
- >2DBox
- {
- <Color 0,0,0
- <Layer 1
- <LineStyle 0,2.0000,0.0000
- <PointXYZ 0, 0, 0
- <PointXYZ 20, .5, 0
- <Type 1
- <Orientation 0
- }
- ' Draws the Inner Border
- >2DBox
- {
- <Color 0,0,0
- <Layer 1
- <LineStyle 0,2.0000,0.0000
- <PointXYZ 0, 2, 0
- <PointXYZ 20, -20, 0
- <Type 1
- <Orientation 0
- }
- ' Fits the drawing to the window
- >FitToWindow
- {
- }
- ' Adds the Description
- >Text
- {
- <Color 0,0,0
- <Layer 1
- <PointXYZ [21, 1, 0]
- <PointXYZ [21, 1, 0]
- <PointXYZ [21, 1, 0]
- <Style 0
- <Justification 2
- <Size .25
- <Angle 0.0000
- <Font "Arial"
- <Text [DIS$]
- }
- ' Adds the DesignCAD
- >Text
- {
- <Color 0,0,0
- <Layer 1
- <PointXYZ [.5, .75, 0]
- <Style 0
- <Justification 0
- <Size 1
- <Angle 0.0000
- <Font "Arial"
- <Text "DesignCAD"
- }
- ' Draws the Outer Border
- >2DBox
- {
- <Color 0,0,0
- <Layer 1
- <LineStyle 0,2.0000,0.0000
- <PointXYZ -.5, 2.5, 0
- <PointXYZ 20.5, -21, 0
- <Type 1
- <Orientation 0
- }
- ' Adds the Archive Filename
- Name$ = "Archive Filename: " + ARC$
- >Text
- {
- <Color 0,0,0
- <Layer 1
- <PointXYZ [0, -20.75, 0]
- <Style 0
- <Justification 0
- <Size .25
- <Angle 0.0000
- <Font "Arial"
- <Text [Name$]
- }
- ' Adds the Group ID
- >Text
- {
- <Color 0,0,0
- <Layer 1
- <PointXYZ [20, 2.1, 0]
- <Style 0
- <Justification 2
- <Size .25
- <Angle 0.0000
- <Font "Arial"
- <Text [GID$]
- }
- ' Fits the drawing to the window
- >FitToWindow
- {
- }
- ' Saves the file
- Input "Please enter the drawing filename . . .", FN$
- >SaveAs
- {
- <SaveChanges 0
- <FileName [FN$]
- }
- >Close
- {
- }
- >New
- {
- }
- close 3
- Count = 0
- goto Back2
- End
-